

<!DOCTYPE html>
<html class="writer-html5" lang="en" data-content_root="./">
<head>
  <meta charset="utf-8" /><meta name="viewport" content="width=device-width, initial-scale=1" />

  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
  <title>pymatgen.analysis.prototypes package &mdash; pymatgen 2025.6.14 documentation</title>
      <link rel="stylesheet" type="text/css" href="assets/pygments.css?v=03e43079" />
      <link rel="stylesheet" type="text/css" href="assets/css/theme.css?v=e59714d7" />
      <link rel="stylesheet" type="text/css" href="assets/css/custom.css" />

  
    <link rel="canonical" href="https://pymatgen.orgpymatgen.analysis.prototypes.html"/>
      <script src="assets/jquery.js?v=5d32c60e"></script>
      <script src="assets/_sphinx_javascript_frameworks_compat.js?v=2cd50e6c"></script>
      <script src="assets/documentation_options.js?v=03bec786"></script>
      <script src="assets/doctools.js?v=9bcbadda"></script>
      <script src="assets/sphinx_highlight.js?v=dc90522c"></script>
    <script src="assets/js/theme.js"></script>
    <link rel="index" title="Index" href="genindex.html" />
    <link rel="search" title="Search" href="search.html" /> 
</head>

<body class="wy-body-for-nav"> 
  <div class="wy-grid-for-nav">
    <nav data-toggle="wy-nav-shift" class="wy-nav-side">
      <div class="wy-side-scroll">
        <div class="wy-side-nav-search"  style="background: linear-gradient(0deg, rgba(23,63,162,1) 0%, rgba(0,70,192,1) 100%)" >

          
          
          <a href="index.html">
            
          </a>
<div role="search">
  <form id="rtd-search-form" class="wy-form" action="search.html" method="get">
    <input type="text" name="q" placeholder="Search docs" aria-label="Search docs" />
    <input type="hidden" name="check_keywords" value="yes" />
    <input type="hidden" name="area" value="default" />
  </form>
</div>
        </div><div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="Navigation menu">
              <!-- Local TOC -->
              <div class="local-toc"><ul>
<li><a class="reference internal" href="#">pymatgen.analysis.prototypes package</a><ul>
<li><a class="reference internal" href="#pymatgen.analysis.prototypes.AflowPrototypeMatcher"><code class="docutils literal notranslate"><span class="pre">AflowPrototypeMatcher</span></code></a><ul>
<li><a class="reference internal" href="#pymatgen.analysis.prototypes.AflowPrototypeMatcher.get_prototypes"><code class="docutils literal notranslate"><span class="pre">AflowPrototypeMatcher.get_prototypes()</span></code></a></li>
</ul>
</li>
<li><a class="reference internal" href="#pymatgen.analysis.prototypes.canonicalize_element_wyckoffs"><code class="docutils literal notranslate"><span class="pre">canonicalize_element_wyckoffs()</span></code></a></li>
<li><a class="reference internal" href="#pymatgen.analysis.prototypes.count_crystal_dof"><code class="docutils literal notranslate"><span class="pre">count_crystal_dof()</span></code></a></li>
<li><a class="reference internal" href="#pymatgen.analysis.prototypes.count_crystal_sites"><code class="docutils literal notranslate"><span class="pre">count_crystal_sites()</span></code></a></li>
<li><a class="reference internal" href="#pymatgen.analysis.prototypes.count_distinct_wyckoff_letters"><code class="docutils literal notranslate"><span class="pre">count_distinct_wyckoff_letters()</span></code></a></li>
<li><a class="reference internal" href="#pymatgen.analysis.prototypes.count_values_for_wyckoff"><code class="docutils literal notranslate"><span class="pre">count_values_for_wyckoff()</span></code></a></li>
<li><a class="reference internal" href="#pymatgen.analysis.prototypes.count_wyckoff_positions"><code class="docutils literal notranslate"><span class="pre">count_wyckoff_positions()</span></code></a></li>
<li><a class="reference internal" href="#pymatgen.analysis.prototypes.get_anonymous_formula_from_prototype_formula"><code class="docutils literal notranslate"><span class="pre">get_anonymous_formula_from_prototype_formula()</span></code></a></li>
<li><a class="reference internal" href="#pymatgen.analysis.prototypes.get_formula_from_protostructure_label"><code class="docutils literal notranslate"><span class="pre">get_formula_from_protostructure_label()</span></code></a></li>
<li><a class="reference internal" href="#pymatgen.analysis.prototypes.get_protostructure_label"><code class="docutils literal notranslate"><span class="pre">get_protostructure_label()</span></code></a></li>
<li><a class="reference internal" href="#pymatgen.analysis.prototypes.get_protostructure_label_from_aflow"><code class="docutils literal notranslate"><span class="pre">get_protostructure_label_from_aflow()</span></code></a></li>
<li><a class="reference internal" href="#pymatgen.analysis.prototypes.get_protostructure_label_from_moyopy"><code class="docutils literal notranslate"><span class="pre">get_protostructure_label_from_moyopy()</span></code></a></li>
<li><a class="reference internal" href="#pymatgen.analysis.prototypes.get_protostructure_label_from_spg_analyzer"><code class="docutils literal notranslate"><span class="pre">get_protostructure_label_from_spg_analyzer()</span></code></a></li>
<li><a class="reference internal" href="#pymatgen.analysis.prototypes.get_protostructure_label_from_spglib"><code class="docutils literal notranslate"><span class="pre">get_protostructure_label_from_spglib()</span></code></a></li>
<li><a class="reference internal" href="#pymatgen.analysis.prototypes.get_protostructures_from_aflow_label_and_composition"><code class="docutils literal notranslate"><span class="pre">get_protostructures_from_aflow_label_and_composition()</span></code></a></li>
<li><a class="reference internal" href="#pymatgen.analysis.prototypes.get_prototype_formula_from_composition"><code class="docutils literal notranslate"><span class="pre">get_prototype_formula_from_composition()</span></code></a></li>
<li><a class="reference internal" href="#pymatgen.analysis.prototypes.get_prototype_from_protostructure"><code class="docutils literal notranslate"><span class="pre">get_prototype_from_protostructure()</span></code></a></li>
<li><a class="reference internal" href="#pymatgen.analysis.prototypes.get_random_structure_for_protostructure"><code class="docutils literal notranslate"><span class="pre">get_random_structure_for_protostructure()</span></code></a></li>
<li><a class="reference internal" href="#pymatgen.analysis.prototypes.sort_and_score_element_wyckoffs"><code class="docutils literal notranslate"><span class="pre">sort_and_score_element_wyckoffs()</span></code></a></li>
<li><a class="reference internal" href="#pymatgen.analysis.prototypes.split_alpha_numeric"><code class="docutils literal notranslate"><span class="pre">split_alpha_numeric()</span></code></a></li>
</ul>
</li>
</ul>
</div>
        </div>
      </div>
    </nav>

    <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap"><nav class="wy-nav-top" aria-label="Mobile navigation menu"  style="background: linear-gradient(0deg, rgba(23,63,162,1) 0%, rgba(0,70,192,1) 100%)" >
          <i data-toggle="wy-nav-top" class="fa fa-bars"></i>
          <a href="index.html">pymatgen</a>
      </nav>

      <div class="wy-nav-content">
        <div class="rst-content style-external-links">
          <div role="navigation" aria-label="Page navigation">
  <ul class="wy-breadcrumbs">
      <li><a href="index.html" class="icon icon-home" aria-label="Home"></a></li>
      <li class="breadcrumb-item active">pymatgen.analysis.prototypes package</li>
      <li class="wy-breadcrumbs-aside">
              <a href="https://github.com/materialsproject/pymatgen/blob/master/docs_rst/pymatgen.analysis.prototypes.rst" class="fa fa-github"> Edit on GitHub</a>
      </li>
  </ul>
  <hr/>
</div>
          <div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
           <div itemprop="articleBody">
             
  <section id="module-pymatgen.analysis.prototypes">
<span id="pymatgen-analysis-prototypes-package"></span><h1>pymatgen.analysis.prototypes package<a class="headerlink" href="#module-pymatgen.analysis.prototypes" title="Link to this heading"></a></h1>
<p>This module is intended to match crystal structures against known crystallographic “prototype”
structures.</p>
<p>In this module, the AflowPrototypeMatcher uses the AFLOW LIBRARY OF CRYSTALLOGRAPHIC PROTOTYPES.
If using this particular class, please cite their publication appropriately:</p>
<p>Mehl, M. J., Hicks, D., Toher, C., Levy, O., Hanson, R. M., Hart, G., &amp; Curtarolo, S. (2017).
The AFLOW library of crystallographic prototypes: part 1.
Computational Materials Science, 136, S1-S828.
<a class="reference external" href="https://doi.org/10.1016/j.commatsci.2017.01.017">https://doi.org/10.1016/j.commatsci.2017.01.017</a></p>
<p>The module also contains functions for getting the protostructure labels from a
variety of symmetry detection libraries (spglib, moyopy, aflow-sym). The protostructure
label is defined as the canonicalized aflow label with the alphabetically sorted
chemical system appended - <cite>aflow_sym_label:chemsys</cite>.</p>
<p>The utilities for determining the protostructure label are upstreamed from the
<cite>aviary</cite> package (<a class="reference external" href="https://github.com/CompRhys/aviary">https://github.com/CompRhys/aviary</a>). If using these functions,
please cite the following publications:</p>
<p>Goodall, R. E., Parackal, A. S., Faber, F. A., Armiento, R., &amp; Lee, A. A. (2022).
Rapid discovery of stable materials by coordinate-free coarse graining.
Science advances, 8(30), eabn4117. <a class="reference external" href="https://doi.org/10.1126/sciadv.abn4117">https://doi.org/10.1126/sciadv.abn4117</a></p>
<p>Parackal, A. S., Goodall, R. E., Faber, F. A., &amp; Armiento, R. (2024).
Identifying crystal structures beyond known prototypes from x-ray powder diffraction spectra.
Physical Review Materials, 8(10), 103801. <a class="reference external" href="https://doi.org/10.1103/PhysRevMaterials.8.103801">https://doi.org/10.1103/PhysRevMaterials.8.103801</a></p>
<dl class="py class">
<dt class="sig sig-object py" id="pymatgen.analysis.prototypes.AflowPrototypeMatcher">
<em class="property"><span class="k"><span class="pre">class</span></span><span class="w"> </span></em><span class="sig-name descname"><span class="pre">AflowPrototypeMatcher</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">initial_ltol</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">float</span></span><span class="w"> </span><span class="o"><span class="pre">=</span></span><span class="w"> </span><span class="default_value"><span class="pre">0.2</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">initial_stol</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">float</span></span><span class="w"> </span><span class="o"><span class="pre">=</span></span><span class="w"> </span><span class="default_value"><span class="pre">0.3</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">initial_angle_tol</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">float</span></span><span class="w"> </span><span class="o"><span class="pre">=</span></span><span class="w"> </span><span class="default_value"><span class="pre">5</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/materialsproject/pymatgen/blob/v2025.6.14/src/pymatgen/core/../analysis/prototypes/__init__.py#L116-L218"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pymatgen.analysis.prototypes.AflowPrototypeMatcher" title="Link to this definition"></a></dt>
<dd><p>Bases: <code class="xref py py-class docutils literal notranslate"><span class="pre">object</span></code></p>
<p>This class will match structures to their crystal prototypes, and will
attempt to group species together to match structures derived from
prototypes (e.g. an A_xB_1-x_C from a binary prototype), and will
give these the names the “-like” suffix.</p>
<p>This class uses data from the AFLOW LIBRARY OF CRYSTALLOGRAPHIC PROTOTYPES.
If using this class, please cite their publication appropriately:</p>
<p>Mehl, M. J., Hicks, D., Toher, C., Levy, O., Hanson, R. M., Hart, G., &amp; Curtarolo, S. (2017).
The AFLOW library of crystallographic prototypes: part 1.
Computational Materials Science, 136, S1-S828.
<a class="reference external" href="https://doi.org/10.1016/j.commatsci.2017.01.017">https://doi.org/10.1016/j.commatsci.2017.01.017</a></p>
<p>Tolerances as defined in StructureMatcher. Tolerances will be
gradually decreased until only a single match is found (if possible).</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>initial_ltol</strong> (<em>float</em>) – fractional length tolerance.</p></li>
<li><p><strong>initial_stol</strong> (<em>float</em>) – site tolerance.</p></li>
<li><p><strong>initial_angle_tol</strong> (<em>float</em>) – angle tolerance.</p></li>
</ul>
</dd>
</dl>
<dl class="py method">
<dt class="sig sig-object py" id="pymatgen.analysis.prototypes.AflowPrototypeMatcher.get_prototypes">
<span class="sig-name descname"><span class="pre">get_prototypes</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">structure</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><a class="reference internal" href="pymatgen.core.html#pymatgen.core.structure.Structure" title="pymatgen.core.structure.Structure"><span class="pre">Structure</span></a></span></em><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">&#x2192;</span> <span class="sig-return-typehint"><span class="pre">list</span><span class="p"><span class="pre">[</span></span><span class="pre">dict</span><span class="p"><span class="pre">]</span></span><span class="w"> </span><span class="p"><span class="pre">|</span></span><span class="w"> </span><span class="pre">None</span></span></span><a class="reference external" href="https://github.com/materialsproject/pymatgen/blob/v2025.6.14/src/pymatgen/core/../analysis/prototypes/__init__.py#L199-L218"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pymatgen.analysis.prototypes.AflowPrototypeMatcher.get_prototypes" title="Link to this definition"></a></dt>
<dd><p>Get prototype(s) structures for a given input structure. If you use this method in
your work, please cite the appropriate AFLOW publication:</p>
<blockquote>
<div><p>Mehl, M. J., Hicks, D., Toher, C., Levy, O., Hanson, R. M., Hart, G., &amp; Curtarolo,
S. (2017). The AFLOW library of crystallographic prototypes: part 1. Computational
Materials Science, 136, S1-S828. <a class="reference external" href="https://doi.org/10.1016/j.commatsci.2017.01.017">https://doi.org/10.1016/j.commatsci.2017.01.017</a></p>
</div></blockquote>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><p><strong>structure</strong> (<a class="reference internal" href="pymatgen.core.html#pymatgen.core.structure.Structure" title="pymatgen.core.structure.Structure"><em>Structure</em></a>) – structure to match</p>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p><dl class="simple">
<dt>A list of dicts with keys “snl” for the matched prototype and</dt><dd><p>”tags”, a dict of tags (“mineral”, “strukturbericht” and “aflow”) of that
prototype. This should be a list containing just a single entry, but it is
possible a material can match multiple prototypes.</p>
</dd>
</dl>
</p>
</dd>
<dt class="field-odd">Return type<span class="colon">:</span></dt>
<dd class="field-odd"><p>list[dict] | None</p>
</dd>
</dl>
</dd></dl>

</dd></dl>

<dl class="py function">
<dt class="sig sig-object py" id="pymatgen.analysis.prototypes.canonicalize_element_wyckoffs">
<span class="sig-name descname"><span class="pre">canonicalize_element_wyckoffs</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">element_wyckoffs</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">str</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">spg_num</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">int</span><span class="w"> </span><span class="p"><span class="pre">|</span></span><span class="w"> </span><span class="pre">str</span></span></em><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">&#x2192;</span> <span class="sig-return-typehint"><span class="pre">str</span></span></span><a class="reference external" href="https://github.com/materialsproject/pymatgen/blob/v2025.6.14/src/pymatgen/core/../analysis/prototypes/__init__.py#L571-L591"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pymatgen.analysis.prototypes.canonicalize_element_wyckoffs" title="Link to this definition"></a></dt>
<dd><p>Given an element ordering, canonicalize the associated Wyckoff positions
based on the alphabetical weight of equivalent choices of origin.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>element_wyckoffs</strong> (<em>str</em>) – wyckoff substring section from aflow_label with the
wyckoff letters for different elements separated by underscores.</p></li>
<li><p><strong>spg_num</strong> (<em>int</em><em> | </em><em>str</em>) – International space group number.</p></li>
</ul>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>element_wyckoff string with canonical ordering of the wyckoff letters.</p>
</dd>
<dt class="field-odd">Return type<span class="colon">:</span></dt>
<dd class="field-odd"><p>str</p>
</dd>
</dl>
</dd></dl>

<dl class="py function">
<dt class="sig sig-object py" id="pymatgen.analysis.prototypes.count_crystal_dof">
<span class="sig-name descname"><span class="pre">count_crystal_dof</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">protostructure_label</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">str</span></span></em><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">&#x2192;</span> <span class="sig-return-typehint"><span class="pre">int</span></span></span><a class="reference external" href="https://github.com/materialsproject/pymatgen/blob/v2025.6.14/src/pymatgen/core/../analysis/prototypes/__init__.py#L719-L738"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pymatgen.analysis.prototypes.count_crystal_dof" title="Link to this definition"></a></dt>
<dd><p>Count number of free parameters in coarse-grained protostructure_label
representation: how many degrees of freedom would remain to optimize during
a crystal structure relaxation.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><p><strong>protostructure_label</strong> (<em>str</em>) – label constructed as <cite>aflow_label:chemsys</cite> where
aflow_label is an AFLOW-style prototype label chemsys is the alphabetically
sorted chemical system.</p>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>Number of free-parameters in given prototype</p>
</dd>
<dt class="field-odd">Return type<span class="colon">:</span></dt>
<dd class="field-odd"><p>int</p>
</dd>
</dl>
</dd></dl>

<dl class="py function">
<dt class="sig sig-object py" id="pymatgen.analysis.prototypes.count_crystal_sites">
<span class="sig-name descname"><span class="pre">count_crystal_sites</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">protostructure_label</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">str</span></span></em><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">&#x2192;</span> <span class="sig-return-typehint"><span class="pre">int</span></span></span><a class="reference external" href="https://github.com/materialsproject/pymatgen/blob/v2025.6.14/src/pymatgen/core/../analysis/prototypes/__init__.py#L741-L755"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pymatgen.analysis.prototypes.count_crystal_sites" title="Link to this definition"></a></dt>
<dd><p>Count number of sites from protostructure_label.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><p><strong>protostructure_label</strong> (<em>str</em>) – label constructed as <cite>aflow_label:chemsys</cite> where
aflow_label is an AFLOW-style prototype label chemsys is the alphabetically
sorted chemical system.</p>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>Number of free-parameters in given prototype</p>
</dd>
<dt class="field-odd">Return type<span class="colon">:</span></dt>
<dd class="field-odd"><p>int</p>
</dd>
</dl>
</dd></dl>

<dl class="py function">
<dt class="sig sig-object py" id="pymatgen.analysis.prototypes.count_distinct_wyckoff_letters">
<span class="sig-name descname"><span class="pre">count_distinct_wyckoff_letters</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">protostructure_label</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">str</span></span></em><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">&#x2192;</span> <span class="sig-return-typehint"><span class="pre">int</span></span></span><a class="reference external" href="https://github.com/materialsproject/pymatgen/blob/v2025.6.14/src/pymatgen/core/../analysis/prototypes/__init__.py#L680-L694"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pymatgen.analysis.prototypes.count_distinct_wyckoff_letters" title="Link to this definition"></a></dt>
<dd><p>Count number of distinct Wyckoff letters in protostructure_label.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><p><strong>protostructure_label</strong> (<em>str</em>) – label constructed as <cite>aflow_label:chemsys</cite> where
aflow_label is an AFLOW-style prototype label chemsys is the alphabetically
sorted chemical system.</p>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>number of distinct Wyckoff letters in protostructure_label</p>
</dd>
<dt class="field-odd">Return type<span class="colon">:</span></dt>
<dd class="field-odd"><p>int</p>
</dd>
</dl>
</dd></dl>

<dl class="py function">
<dt class="sig sig-object py" id="pymatgen.analysis.prototypes.count_values_for_wyckoff">
<span class="sig-name descname"><span class="pre">count_values_for_wyckoff</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">element_wyckoffs</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">list</span><span class="p"><span class="pre">[</span></span><span class="pre">str</span><span class="p"><span class="pre">]</span></span></span></em>, <em class="sig-param"><span class="n"><span class="pre">counts</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">list</span><span class="p"><span class="pre">[</span></span><span class="pre">str</span><span class="p"><span class="pre">]</span></span></span></em>, <em class="sig-param"><span class="n"><span class="pre">spg_num</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">str</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">lookup_dict</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">dict</span><span class="p"><span class="pre">[</span></span><span class="pre">str</span><span class="p"><span class="pre">,</span></span><span class="w"> </span><span class="pre">dict</span><span class="p"><span class="pre">[</span></span><span class="pre">str</span><span class="p"><span class="pre">,</span></span><span class="w"> </span><span class="pre">int</span><span class="p"><span class="pre">]</span></span><span class="p"><span class="pre">]</span></span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/materialsproject/pymatgen/blob/v2025.6.14/src/pymatgen/core/../analysis/prototypes/__init__.py#L238-L248"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pymatgen.analysis.prototypes.count_values_for_wyckoff" title="Link to this definition"></a></dt>
<dd><p>Count values from a lookup table and scale by wyckoff multiplicities.</p>
</dd></dl>

<dl class="py function">
<dt class="sig sig-object py" id="pymatgen.analysis.prototypes.count_wyckoff_positions">
<span class="sig-name descname"><span class="pre">count_wyckoff_positions</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">protostructure_label</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">str</span></span></em><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">&#x2192;</span> <span class="sig-return-typehint"><span class="pre">int</span></span></span><a class="reference external" href="https://github.com/materialsproject/pymatgen/blob/v2025.6.14/src/pymatgen/core/../analysis/prototypes/__init__.py#L697-L716"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pymatgen.analysis.prototypes.count_wyckoff_positions" title="Link to this definition"></a></dt>
<dd><p>Count number of Wyckoff positions in protostructure_label.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><p><strong>protostructure_label</strong> (<em>str</em>) – label constructed as <cite>aflow_label:chemsys</cite> where
aflow_label is an AFLOW-style prototype label chemsys is the alphabetically
sorted chemical system.</p>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>number of distinct Wyckoff positions in protostructure_label</p>
</dd>
<dt class="field-odd">Return type<span class="colon">:</span></dt>
<dd class="field-odd"><p>int</p>
</dd>
</dl>
</dd></dl>

<dl class="py function">
<dt class="sig sig-object py" id="pymatgen.analysis.prototypes.get_anonymous_formula_from_prototype_formula">
<span class="sig-name descname"><span class="pre">get_anonymous_formula_from_prototype_formula</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">prototype_formula</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">str</span></span></em><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">&#x2192;</span> <span class="sig-return-typehint"><span class="pre">str</span></span></span><a class="reference external" href="https://github.com/materialsproject/pymatgen/blob/v2025.6.14/src/pymatgen/core/../analysis/prototypes/__init__.py#L656-L664"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pymatgen.analysis.prototypes.get_anonymous_formula_from_prototype_formula" title="Link to this definition"></a></dt>
<dd><p>Get an anonymous formula from a prototype formula.</p>
</dd></dl>

<dl class="py function">
<dt class="sig sig-object py" id="pymatgen.analysis.prototypes.get_formula_from_protostructure_label">
<span class="sig-name descname"><span class="pre">get_formula_from_protostructure_label</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">protostructure_label</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">str</span></span></em><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">&#x2192;</span> <span class="sig-return-typehint"><span class="pre">str</span></span></span><a class="reference external" href="https://github.com/materialsproject/pymatgen/blob/v2025.6.14/src/pymatgen/core/../analysis/prototypes/__init__.py#L667-L677"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pymatgen.analysis.prototypes.get_formula_from_protostructure_label" title="Link to this definition"></a></dt>
<dd><p>Get a formula from a protostructure label.</p>
</dd></dl>

<dl class="py function">
<dt class="sig sig-object py" id="pymatgen.analysis.prototypes.get_protostructure_label">
<span class="sig-name descname"><span class="pre">get_protostructure_label</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">struct</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><a class="reference internal" href="pymatgen.core.html#pymatgen.core.structure.Structure" title="pymatgen.core.structure.Structure"><span class="pre">Structure</span></a></span></em>, <em class="sig-param"><span class="n"><span class="pre">method</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">Literal</span><span class="p"><span class="pre">[</span></span><span class="s"><span class="pre">'aflow'</span></span><span class="p"><span class="pre">,</span></span><span class="w"> </span><span class="s"><span class="pre">'spglib'</span></span><span class="p"><span class="pre">,</span></span><span class="w"> </span><span class="s"><span class="pre">'moyopy'</span></span><span class="p"><span class="pre">]</span></span></span></em>, <em class="sig-param"><span class="n"><span class="pre">raise_errors</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">bool</span></span><span class="w"> </span><span class="o"><span class="pre">=</span></span><span class="w"> </span><span class="default_value"><span class="pre">False</span></span></em>, <em class="sig-param"><span class="o"><span class="pre">**</span></span><span class="n"><span class="pre">kwargs</span></span></em><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">&#x2192;</span> <span class="sig-return-typehint"><span class="pre">str</span><span class="w"> </span><span class="p"><span class="pre">|</span></span><span class="w"> </span><span class="pre">None</span></span></span><a class="reference external" href="https://github.com/materialsproject/pymatgen/blob/v2025.6.14/src/pymatgen/core/../analysis/prototypes/__init__.py#L251-L282"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pymatgen.analysis.prototypes.get_protostructure_label" title="Link to this definition"></a></dt>
<dd><p>Get protostructure label for a pymatgen Structure.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>struct</strong> (<a class="reference internal" href="pymatgen.core.html#pymatgen.core.structure.Structure" title="pymatgen.core.structure.Structure"><em>Structure</em></a>) – pymatgen Structure</p></li>
<li><p><strong>method</strong> (<em>Literal</em><em>[</em><em>&quot;aflow&quot;</em><em>, </em><em>&quot;spglib&quot;</em><em>, </em><em>&quot;moyopy&quot;</em><em>]</em>) – Method to use for symmetry</p></li>
<li><p><strong>detection</strong></p></li>
<li><p><strong>raise_errors</strong> (<em>bool</em>) – Whether to raise errors or annotate them. Defaults to
False.</p></li>
<li><p><strong>**kwargs</strong> – Additional arguments for the specific method</p></li>
</ul>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p><dl class="simple">
<dt>protostructure_label which is constructed as <cite>aflow_label:chemsys</cite> or</dt><dd><p>explanation of failure if symmetry detection failed and <cite>raise_errors</cite>
is False.</p>
</dd>
</dl>
</p>
</dd>
<dt class="field-odd">Return type<span class="colon">:</span></dt>
<dd class="field-odd"><p>str</p>
</dd>
</dl>
</dd></dl>

<dl class="py function">
<dt class="sig sig-object py" id="pymatgen.analysis.prototypes.get_protostructure_label_from_aflow">
<span class="sig-name descname"><span class="pre">get_protostructure_label_from_aflow</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">struct</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><a class="reference internal" href="pymatgen.core.html#pymatgen.core.structure.Structure" title="pymatgen.core.structure.Structure"><span class="pre">Structure</span></a></span></em>, <em class="sig-param"><span class="n"><span class="pre">raise_errors</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">bool</span></span><span class="w"> </span><span class="o"><span class="pre">=</span></span><span class="w"> </span><span class="default_value"><span class="pre">False</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">aflow_executable</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">str</span><span class="w"> </span><span class="p"><span class="pre">|</span></span><span class="w"> </span><span class="pre">None</span></span><span class="w"> </span><span class="o"><span class="pre">=</span></span><span class="w"> </span><span class="default_value"><span class="pre">None</span></span></em><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">&#x2192;</span> <span class="sig-return-typehint"><span class="pre">str</span></span></span><a class="reference external" href="https://github.com/materialsproject/pymatgen/blob/v2025.6.14/src/pymatgen/core/../analysis/prototypes/__init__.py#L285-L364"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pymatgen.analysis.prototypes.get_protostructure_label_from_aflow" title="Link to this definition"></a></dt>
<dd><p>Get protostructure label for a pymatgen Structure. Make sure you’re running a
recent version of the aflow CLI as there’s been several breaking changes. This code
was tested under v3.2.12. The protostructure label is constructed as
<cite>aflow_label:chemsys</cite>.</p>
<dl class="simple">
<dt>Install guide: <a class="reference external" href="https://aflow.org/install-aflow/#install_aflow">https://aflow.org/install-aflow/#install_aflow</a></dt><dd><p><a class="reference external" href="http://aflow.org/install-aflow/install-aflow.sh">http://aflow.org/install-aflow/install-aflow.sh</a> -o install-aflow.sh
chmod 555 install-aflow.sh
./install-aflow.sh –slim</p>
</dd>
</dl>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>struct</strong> (<a class="reference internal" href="pymatgen.core.html#pymatgen.core.structure.Structure" title="pymatgen.core.structure.Structure"><em>Structure</em></a>) – pymatgen Structure</p></li>
<li><p><strong>aflow_executable</strong> (<em>str</em>) – path to aflow executable. Defaults to which(“aflow”).</p></li>
<li><p><strong>raise_errors</strong> (<em>bool</em>) – Whether to raise errors or annotate them. Defaults to
False.</p></li>
</ul>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p><dl class="simple">
<dt>protostructure_label which is constructed as <cite>aflow_label:chemsys</cite> or</dt><dd><p>explanation of failure if symmetry detection failed and <cite>raise_errors</cite>
is False.</p>
</dd>
</dl>
</p>
</dd>
<dt class="field-odd">Return type<span class="colon">:</span></dt>
<dd class="field-odd"><p>str</p>
</dd>
</dl>
</dd></dl>

<dl class="py function">
<dt class="sig sig-object py" id="pymatgen.analysis.prototypes.get_protostructure_label_from_moyopy">
<span class="sig-name descname"><span class="pre">get_protostructure_label_from_moyopy</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">struct</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><a class="reference internal" href="pymatgen.core.html#pymatgen.core.structure.Structure" title="pymatgen.core.structure.Structure"><span class="pre">Structure</span></a></span></em>, <em class="sig-param"><span class="n"><span class="pre">raise_errors</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">bool</span></span><span class="w"> </span><span class="o"><span class="pre">=</span></span><span class="w"> </span><span class="default_value"><span class="pre">False</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">symprec</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">float</span></span><span class="w"> </span><span class="o"><span class="pre">=</span></span><span class="w"> </span><span class="default_value"><span class="pre">0.1</span></span></em><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">&#x2192;</span> <span class="sig-return-typehint"><span class="pre">str</span><span class="w"> </span><span class="p"><span class="pre">|</span></span><span class="w"> </span><span class="pre">None</span></span></span><a class="reference external" href="https://github.com/materialsproject/pymatgen/blob/v2025.6.14/src/pymatgen/core/../analysis/prototypes/__init__.py#L505-L568"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pymatgen.analysis.prototypes.get_protostructure_label_from_moyopy" title="Link to this definition"></a></dt>
<dd><p>Get AFLOW prototype label using Moyopy for symmetry detection.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>struct</strong> (<a class="reference internal" href="pymatgen.core.html#pymatgen.core.structure.Structure" title="pymatgen.core.structure.Structure"><em>Structure</em></a>) – pymatgen Structure object.</p></li>
<li><p><strong>raise_errors</strong> (<em>bool</em>) – Whether to raise errors or annotate them. Defaults to
False.</p></li>
<li><p><strong>symprec</strong> (<em>float</em>) – Initial symmetry precision for Moyopy. Defaults to 0.1.</p></li>
</ul>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p><dl class="simple">
<dt>protostructure_label which is constructed as <cite>aflow_label:chemsys</cite> or</dt><dd><p>explanation of failure if symmetry detection failed and <cite>raise_errors</cite>
is False.</p>
</dd>
</dl>
</p>
</dd>
<dt class="field-odd">Return type<span class="colon">:</span></dt>
<dd class="field-odd"><p>str</p>
</dd>
</dl>
</dd></dl>

<dl class="py function">
<dt class="sig sig-object py" id="pymatgen.analysis.prototypes.get_protostructure_label_from_spg_analyzer">
<span class="sig-name descname"><span class="pre">get_protostructure_label_from_spg_analyzer</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">spg_analyzer</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><a class="reference internal" href="pymatgen.symmetry.html#pymatgen.symmetry.analyzer.SpacegroupAnalyzer" title="pymatgen.symmetry.analyzer.SpacegroupAnalyzer"><span class="pre">SpacegroupAnalyzer</span></a></span></em>, <em class="sig-param"><span class="n"><span class="pre">raise_errors</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">bool</span></span><span class="w"> </span><span class="o"><span class="pre">=</span></span><span class="w"> </span><span class="default_value"><span class="pre">False</span></span></em><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">&#x2192;</span> <span class="sig-return-typehint"><span class="pre">str</span></span></span><a class="reference external" href="https://github.com/materialsproject/pymatgen/blob/v2025.6.14/src/pymatgen/core/../analysis/prototypes/__init__.py#L406-L451"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pymatgen.analysis.prototypes.get_protostructure_label_from_spg_analyzer" title="Link to this definition"></a></dt>
<dd><p>Get protostructure label for pymatgen SpacegroupAnalyzer.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>spg_analyzer</strong> (<a class="reference internal" href="pymatgen.symmetry.html#pymatgen.symmetry.analyzer.SpacegroupAnalyzer" title="pymatgen.symmetry.analyzer.SpacegroupAnalyzer"><em>SpacegroupAnalyzer</em></a>) – pymatgen SpacegroupAnalyzer object.</p></li>
<li><p><strong>raise_errors</strong> (<em>bool</em>) – Whether to raise errors or annotate them. Defaults to
False.</p></li>
</ul>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p><dl class="simple">
<dt>protostructure_label which is constructed as <cite>aflow_label:chemsys</cite> or</dt><dd><p>explanation of failure if symmetry detection failed and <cite>raise_errors</cite>
is False.</p>
</dd>
</dl>
</p>
</dd>
<dt class="field-odd">Return type<span class="colon">:</span></dt>
<dd class="field-odd"><p>str</p>
</dd>
</dl>
</dd></dl>

<dl class="py function">
<dt class="sig sig-object py" id="pymatgen.analysis.prototypes.get_protostructure_label_from_spglib">
<span class="sig-name descname"><span class="pre">get_protostructure_label_from_spglib</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">struct</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><a class="reference internal" href="pymatgen.core.html#pymatgen.core.structure.Structure" title="pymatgen.core.structure.Structure"><span class="pre">Structure</span></a></span></em>, <em class="sig-param"><span class="n"><span class="pre">raise_errors</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">bool</span></span><span class="w"> </span><span class="o"><span class="pre">=</span></span><span class="w"> </span><span class="default_value"><span class="pre">False</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">init_symprec</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">float</span></span><span class="w"> </span><span class="o"><span class="pre">=</span></span><span class="w"> </span><span class="default_value"><span class="pre">0.1</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">fallback_symprec</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">float</span><span class="w"> </span><span class="p"><span class="pre">|</span></span><span class="w"> </span><span class="pre">None</span></span><span class="w"> </span><span class="o"><span class="pre">=</span></span><span class="w"> </span><span class="default_value"><span class="pre">1e-05</span></span></em><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">&#x2192;</span> <span class="sig-return-typehint"><span class="pre">str</span></span></span><a class="reference external" href="https://github.com/materialsproject/pymatgen/blob/v2025.6.14/src/pymatgen/core/../analysis/prototypes/__init__.py#L454-L502"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pymatgen.analysis.prototypes.get_protostructure_label_from_spglib" title="Link to this definition"></a></dt>
<dd><p>Get AFLOW prototype label for pymatgen Structure.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>struct</strong> (<a class="reference internal" href="pymatgen.core.html#pymatgen.core.structure.Structure" title="pymatgen.core.structure.Structure"><em>Structure</em></a>) – pymatgen Structure object.</p></li>
<li><p><strong>raise_errors</strong> (<em>bool</em>) – Whether to raise errors or annotate them. Defaults to
False.</p></li>
<li><p><strong>init_symprec</strong> (<em>float</em>) – Initial symmetry precision for spglib. Defaults to 0.1.</p></li>
<li><p><strong>fallback_symprec</strong> (<em>float</em>) – Fallback symmetry precision for spglib if first
symmetry detection failed. Defaults to 1e-5.</p></li>
</ul>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p><dl class="simple">
<dt>protostructure_label which is constructed as <cite>aflow_label:chemsys</cite> or</dt><dd><p>explanation of failure if symmetry detection failed and <cite>raise_errors</cite>
is False.</p>
</dd>
</dl>
</p>
</dd>
<dt class="field-odd">Return type<span class="colon">:</span></dt>
<dd class="field-odd"><p>str</p>
</dd>
</dl>
</dd></dl>

<dl class="py function">
<dt class="sig sig-object py" id="pymatgen.analysis.prototypes.get_protostructures_from_aflow_label_and_composition">
<span class="sig-name descname"><span class="pre">get_protostructures_from_aflow_label_and_composition</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">aflow_label</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">str</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">composition</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><a class="reference internal" href="pymatgen.core.html#pymatgen.core.composition.Composition" title="pymatgen.core.composition.Composition"><span class="pre">Composition</span></a></span></em><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">&#x2192;</span> <span class="sig-return-typehint"><span class="pre">list</span><span class="p"><span class="pre">[</span></span><span class="pre">str</span><span class="p"><span class="pre">]</span></span></span></span><a class="reference external" href="https://github.com/materialsproject/pymatgen/blob/v2025.6.14/src/pymatgen/core/../analysis/prototypes/__init__.py#L882-L913"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pymatgen.analysis.prototypes.get_protostructures_from_aflow_label_and_composition" title="Link to this definition"></a></dt>
<dd><p>Get a canonicalized string for the prototype.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>aflow_label</strong> (<em>str</em>) – AFLOW-style prototype label</p></li>
<li><p><strong>composition</strong> (<a class="reference internal" href="pymatgen.core.html#pymatgen.core.composition.Composition" title="pymatgen.core.composition.Composition"><em>Composition</em></a>) – pymatgen Composition object</p></li>
</ul>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p><dl class="simple">
<dt>List of possible protostructure labels that can be generated</dt><dd><p>from combinations of the input aflow_label and composition.</p>
</dd>
</dl>
</p>
</dd>
<dt class="field-odd">Return type<span class="colon">:</span></dt>
<dd class="field-odd"><p>list[str]</p>
</dd>
</dl>
</dd></dl>

<dl class="py function">
<dt class="sig sig-object py" id="pymatgen.analysis.prototypes.get_prototype_formula_from_composition">
<span class="sig-name descname"><span class="pre">get_prototype_formula_from_composition</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">composition</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><a class="reference internal" href="pymatgen.core.html#pymatgen.core.composition.Composition" title="pymatgen.core.composition.Composition"><span class="pre">Composition</span></a></span></em><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">&#x2192;</span> <span class="sig-return-typehint"><span class="pre">str</span></span></span><a class="reference external" href="https://github.com/materialsproject/pymatgen/blob/v2025.6.14/src/pymatgen/core/../analysis/prototypes/__init__.py#L626-L653"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pymatgen.analysis.prototypes.get_prototype_formula_from_composition" title="Link to this definition"></a></dt>
<dd><p>An anonymized formula. Unique species are arranged in alphabetical order
and assigned ascending alphabets. This format is used in the aflow structure
prototype labelling scheme.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><p><strong>composition</strong> (<a class="reference internal" href="pymatgen.core.html#pymatgen.core.composition.Composition" title="pymatgen.core.composition.Composition"><em>Composition</em></a>) – Pymatgen Composition to process</p>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>anonymized formula where the species are in alphabetical order</p>
</dd>
<dt class="field-odd">Return type<span class="colon">:</span></dt>
<dd class="field-odd"><p>str</p>
</dd>
</dl>
</dd></dl>

<dl class="py function">
<dt class="sig sig-object py" id="pymatgen.analysis.prototypes.get_prototype_from_protostructure">
<span class="sig-name descname"><span class="pre">get_prototype_from_protostructure</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">protostructure_label</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">str</span></span></em><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">&#x2192;</span> <span class="sig-return-typehint"><span class="pre">str</span></span></span><a class="reference external" href="https://github.com/materialsproject/pymatgen/blob/v2025.6.14/src/pymatgen/core/../analysis/prototypes/__init__.py#L775-L829"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pymatgen.analysis.prototypes.get_prototype_from_protostructure" title="Link to this definition"></a></dt>
<dd><p>Get a canonicalized string for the prototype. This prototype should be
the same for all isopointal protostructures.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><p><strong>protostructure_label</strong> (<em>str</em>) – label constructed as <cite>aflow_label:chemsys</cite> where
aflow_label is an AFLOW-style prototype label chemsys is the alphabetically
sorted chemical system.</p>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>Canonicalized AFLOW-style prototype label</p>
</dd>
<dt class="field-odd">Return type<span class="colon">:</span></dt>
<dd class="field-odd"><p>str</p>
</dd>
</dl>
</dd></dl>

<dl class="py function">
<dt class="sig sig-object py" id="pymatgen.analysis.prototypes.get_random_structure_for_protostructure">
<span class="sig-name descname"><span class="pre">get_random_structure_for_protostructure</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">protostructure_label</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">str</span></span></em>, <em class="sig-param"><span class="o"><span class="pre">**</span></span><span class="n"><span class="pre">kwargs</span></span></em><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">&#x2192;</span> <span class="sig-return-typehint"><a class="reference internal" href="pymatgen.core.html#pymatgen.core.structure.Structure" title="pymatgen.core.structure.Structure"><span class="pre">Structure</span></a></span></span><a class="reference external" href="https://github.com/materialsproject/pymatgen/blob/v2025.6.14/src/pymatgen/core/../analysis/prototypes/__init__.py#L916-L962"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pymatgen.analysis.prototypes.get_random_structure_for_protostructure" title="Link to this definition"></a></dt>
<dd><p>Generate a random structure for a given prototype structure.</p>
<p>NOTE that due to the random nature of the generation, the output structure
may be higher symmetry than the requested prototype structure.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>protostructure_label</strong> (<em>str</em>) – label constructed as <cite>aflow_label:chemsys</cite> where
aflow_label is an AFLOW-style prototype label chemsys is the alphabetically
sorted chemical system.</p></li>
<li><p><strong>**kwargs</strong> – Keyword arguments to pass to pyxtal().from_random()</p></li>
</ul>
</dd>
</dl>
</dd></dl>

<dl class="py function">
<dt class="sig sig-object py" id="pymatgen.analysis.prototypes.sort_and_score_element_wyckoffs">
<span class="sig-name descname"><span class="pre">sort_and_score_element_wyckoffs</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">element_wyckoffs</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">str</span></span></em><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">&#x2192;</span> <span class="sig-return-typehint"><span class="pre">tuple</span><span class="p"><span class="pre">[</span></span><span class="pre">str</span><span class="p"><span class="pre">,</span></span><span class="w"> </span><span class="pre">int</span><span class="p"><span class="pre">]</span></span></span></span><a class="reference external" href="https://github.com/materialsproject/pymatgen/blob/v2025.6.14/src/pymatgen/core/../analysis/prototypes/__init__.py#L594-L623"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pymatgen.analysis.prototypes.sort_and_score_element_wyckoffs" title="Link to this definition"></a></dt>
<dd><p>Determines the order or Wyckoff positions when canonicalizing AFLOW labels.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><p><strong>element_wyckoffs</strong> (<em>str</em>) – wyckoff substring section from aflow_label with the
wyckoff letters for different elements separated by underscores.</p>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>containing
- str: sorted Wyckoff position substring for AFLOW-style prototype label
- int: integer score to rank order when canonicalizing</p>
</dd>
<dt class="field-odd">Return type<span class="colon">:</span></dt>
<dd class="field-odd"><p>tuple</p>
</dd>
</dl>
</dd></dl>

<dl class="py function">
<dt class="sig sig-object py" id="pymatgen.analysis.prototypes.split_alpha_numeric">
<span class="sig-name descname"><span class="pre">split_alpha_numeric</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">s</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">str</span></span></em><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">&#x2192;</span> <span class="sig-return-typehint"><span class="pre">dict</span><span class="p"><span class="pre">[</span></span><span class="pre">str</span><span class="p"><span class="pre">,</span></span><span class="w"> </span><span class="pre">list</span><span class="p"><span class="pre">[</span></span><span class="pre">str</span><span class="p"><span class="pre">]</span></span><span class="p"><span class="pre">]</span></span></span></span><a class="reference external" href="https://github.com/materialsproject/pymatgen/blob/v2025.6.14/src/pymatgen/core/../analysis/prototypes/__init__.py#L221-L235"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pymatgen.analysis.prototypes.split_alpha_numeric" title="Link to this definition"></a></dt>
<dd><p>Split a string into separate lists of alpha and numeric groups.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><p><strong>s</strong> (<em>str</em>) – The input string to split.</p>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p><dl class="simple">
<dt>A dictionary with keys ‘alpha’ and ‘numeric’,</dt><dd><p>each containing a list of the respective groups.</p>
</dd>
</dl>
</p>
</dd>
<dt class="field-odd">Return type<span class="colon">:</span></dt>
<dd class="field-odd"><p>dict[str, list[str]]</p>
</dd>
</dl>
</dd></dl>

</section>


           </div>
          </div>
          <footer>

  <hr/>

  <div role="contentinfo">
    <p>&#169; Copyright 2011, Pymatgen Development Team.</p>
  </div>

  Built with <a href="https://www.sphinx-doc.org/">Sphinx</a> using a
    <a href="https://github.com/readthedocs/sphinx_rtd_theme">theme</a>
    provided by <a href="https://readthedocs.org">Read the Docs</a>.
   

</footer>
        </div>
      </div>
    </section>
  </div>
  <script>
      jQuery(function () {
          SphinxRtdTheme.Navigation.enable(true);
      });
  </script> 

</body>
</html>
